package com.zhouyong.controller;

import com.zhouyong.domain.response.Result;
import com.zhouyong.joggle.UserService;
import com.zhouyong.netty.NettyClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 99Savage
 * @date 2023/3/16 15:11
 */
@RestController
public class TestController {

    @PostMapping("/eat")
    public String eat(@RequestParam String param) {
        UserService userService = (UserService) NettyClient.createProxyInstance(UserService.class);
        return userService.eat(param);
    }

    @GetMapping("/listen")
    public Result<?> listen() {
        UserService userService = (UserService) NettyClient.createProxyInstance(UserService.class);
        return userService.listen();
    }
}
